package exchange

import (
	"github.com/shopspring/decimal"
	"log"
	"strconv"
	"strings"
)

func GetLiuliuliu(available_0 int,available_0_denom int,step_2_symbol_lotDenom int) int {
	if available_0!=0 && available_0_denom!=0 {
		log.Println("DEBUG===========",available_0,available_0_denom,step_2_symbol_lotDenom)
		available_0_float:=IntToFloat64(available_0)
		available_0_v1:=decimal.NewFromFloat(available_0_float)
		available_0_dem_float:=IntToFloat64(available_0_denom)
		available_0_dem_float_v1:=decimal.NewFromFloat(available_0_dem_float)
		available_0_v2:=available_0_v1.Div(available_0_dem_float_v1)
		available_0_lot_dem_float:=IntToFloat64(step_2_symbol_lotDenom)
		available_0_lot_dem_dec:=decimal.NewFromFloat(available_0_lot_dem_float)
		available_0_v3:=available_0_v2.Mul(available_0_lot_dem_dec).String()
		available_0_v4:=strings.Split(available_0_v3,".")
		available_0_v5,_:=strconv.Atoi(available_0_v4[0])

		return available_0_v5
	}
	return -1
}
